#pragma once

#include <QObject>
#include "HttpRequest.h"
#include <QTcpSocket>

class ApiController : public QObject
{
    Q_OBJECT

public:
    ApiController(QObject *parent);
    ~ApiController();

public slots:
    void onRecieveService(const HttpRequest &, QTcpSocket *);

signals:
    void invokeAction(int, QVariantList, QTcpSocket *);
    void writeProperties(QMap<QString, QVariant>, QTcpSocket *);
	void readProperties(QStringList, QTcpSocket *);
    void readAllProperties(QTcpSocket *);

private:
    void postService(const HttpRequest &, QTcpSocket *);
    void getService(const HttpRequest &, QTcpSocket *);
};
